#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
	FILE* fr = fopen("data.txt", "r");
	if (fr == NULL)
	{
		perror("open for read");
		return 1;
	}
	FILE* fw = fopen("data_copy.txt", "w");
	if (fw == NULL)
	{
		perror("open for write");
		return 1;
	}
	int ch = 0;
	while ((ch = fgetc(fr)) != EOF)
	{
		fputc(ch, fw);
	}
	fclose(fr);
	fr == NULL;
	fclose(fw);
	fw = NULL;
	return 0;
}